# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=nemo-qml-plugin-calendar
pkgver=0.6.46
pkgrel=1
pkgdesc="Nemo QML calendar plugin"
url="https://github.com/sailfishos/nemo-qml-plugin-calendar"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
license="LGPL-2.1-or-later"
makedepends="
	extra-cmake-modules
	kcalendarcore5-dev
	libaccounts-qt-dev
	mkcal-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	samurai
	"
checkdepends="xvfb-run"
source="https://github.com/sailfishos/nemo-qml-plugin-calendar/archive/$pkgver/nemo-qml-plugin-calendar-$pkgver.tar.gz
	0001-Port-to-CMake.patch
	"
options="!check" # Broken

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DINSTALL_QML_IMPORT_DIR=/usr/lib/qt5/qml
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
63e69f7dc0e9e8176b44de7c1f0ac18ab81cf50f494e1bbe478b01cc37207f72d7433e54c1deb5dfff01e35404a5df761fab7a5fdac8aa6db8afb16bb1fca3fd  nemo-qml-plugin-calendar-0.6.46.tar.gz
97c43abf4e40dc058d4fa3fe1abdaa897264131f43e8256ba0d03473cf011edc24738016803f01a41eda575fdd1c0e554df9e12864b81fa3337b928e34f10278  0001-Port-to-CMake.patch
"
